<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*,com.stone.business.workcard.pojo.MapType,com.stone.business.workcard.pojo.MainWorkCardOne"%> 
<%@ page isELIgnored="false"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c"  uri="/c.tld" %>
<%@ taglib prefix="fmt"  uri="/fmt.tld" %>
<%@ taglib prefix="fn" uri="/fn.tld" %> 
<%@ page import="com.stone.para.IConstant"%>
<%
	String contextPath = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

	
	<title>My JSF 'printworkcard.jsp' starting page</title>
	
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script> 
	<script type="text/javascript" src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=contextPath%>/ext3/ext-all.js"></script>		
	<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
	<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/ext3/resources/css/ext-all.css">
		
	
<style type="text/css">
.table_print{	
	border:1px solid #000000;
	border-collapse:collapse;
}
.table_print td{
	border:1px solid #000000;
	border-collapse:collapse;
	empty-cells:show;
	line-height:24px;	
	padding-left:6px;
} 
</style>
    <style media="print">.Noprint { DISPLAY: none }</style>
<script type="text/javascript" language="javascript">  
			
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '打印预览',
				            icon:"/DLPLANMIS/images/PrintPreview.gif",
				            handler:function() {
				            	document.getElementById("tbar").style.display ="none";// = "display:none";
				            	webbrowser.ExecWB(7,1);
				            	document.getElementById("tbar").style.display ="";// = "display:none";
				            }
				        }/*,'-',
				        {
				            text: '关闭',
				            icon:"/DLPLANMIS/images/banjie.png",
				            handler:function(){
				            	window.close();
				            }
				        }*/
			    	]
			    });
			});
 			function func_load(){
				var imageId='${entity.pic_id}';	
				////alert(imageId);			
				//if(imageId!="0"){
				if(imageId=="0"){
				var picture=document.getElementById("myImage");
				//picture.src="workcardOne!fileDownload.do?id=${entity.pic_id}";	
				picture.src='${picUrl}';	
				//alert(picture.src);
				picture.style.width="700px";
				picture.style.height="500px";				
				}
				
				
			}
		 </script>  
</head>
<body onload="func_load();">
<div id = "tbar" class="Noprint" style="position:absolute;display:block left:0px; top:0px; width:100%; height:25px; z-index:1;"></div>	
<p align="center"><span  style="font: 22pt/22pt 宋体;"><strong>班组作业控制卡(一种票)</strong></span></p>
<br>
<p> <div align="center">票号：<span style="BORDER-BOTTOM: #000000 1px solid; display: inline-block; width: 150px; text-align: left;font-family: 宋体; font-size: 12pt">
					&nbsp;${entity.pno}&nbsp;
				</span>
编写：<span style="BORDER-BOTTOM: #000000 1px solid; display: inline-block; width:150px; text-align: left;font-family: 宋体; font-size: 12pt">
					&nbsp;${entity.bxr}&nbsp;
				</span>			
审批：<span style="BORDER-BOTTOM: #000000 1px solid; display: inline-block; width: 150px; text-align: left;font-family: 宋体; font-size: 12pt">
					&nbsp;${entity.sp}&nbsp;
				</span>	
</div>					
</p>		
<br />
<span style="font-family: &quot;黑体&quot;; font-size: 12pt">1.现场安全措施示意图</span>	
<br />
<table style="border-bottom: medium none; border-left: medium none; margin: auto auto auto 0.15pt; border-collapse: collapse; border-top: medium none; border-right: medium none" border="0" cellspacing="0" cellpadding="0" width="100%" bordercolor="#000000">
<tr><td height="400px">
<table width="100%" height="400px" class="table_print"  cellpadding="0" cellspacing="0">
<tr><td align="center"><img id ="myImage" style="width:700px" height="500px"/></td></tr>
</table>
</td></tr>
<tr>
  <td><span style="font-family: &quot;黑体&quot;; font-size: 12pt">2.安全工器具检查（合格打√，不合格打×）</span></td>
</tr>
<tr>
<td>
<table width="100%" class="table_print" cellpadding="0"  cellspacing="0">
<tr>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">名称</span></span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">检查情况</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">名称</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">检查情况</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">名称</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">检查情况</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">名称</span></div></td>
<td><div align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">检查情况</span></div></td>
</tr>
<%      List<Map<String,String>> list=(List<Map<String,String>>)request.getAttribute("listcheckbox");		
		MainWorkCardOne workcardOne=(MainWorkCardOne)request.getAttribute("entity");		
		List<String> list_check_tools=null;		
		if(workcardOne.getCheck_tools()!=null){
			String[] array_check_tools= workcardOne.getCheck_tools().split(",");
			list_check_tools=Arrays.asList(array_check_tools);
		}else{			
			list_check_tools=new ArrayList<String>();
		}
		int listSize=list.size();
		int rowcnt=listSize+1;//1为最后的检查人签名
		int pageSize=4;
		int pageCount=rowcnt%pageSize;
		if(pageCount==0){
			pageCount=rowcnt/pageSize;
		}else{
			pageCount=rowcnt/pageSize+1;
		}
		for(int i=0;i<pageCount;i++){
		out.println("<tr>");
		for(int k=0;k<4;k++){
		if((i*4+k)<listSize){		
		Map<String,String> mapType=list.get((i*4+k));
		String name=mapType.get("keyid");

%>

<td align="center"><%=name%></td>
<td align="center"><input type="checkbox"  name="list" value="<%=name%>" <%=(list_check_tools.contains(name))?"checked":""%>/></td>
<%

}
else if((i*4+k)==pageCount*4-1){
%>
<td align="center">检查人签名：</td>
<td align="center">&nbsp;</td>
<%
}else{
%>
<td align="center">&nbsp;</td>
<td align="center">&nbsp;</td>
<%
}
}
out.println("</tr>");
}%>

</table>
</td>
</tr>
<tr>
<td>
<span style="font-family: &quot;黑体&quot;; font-size: 12pt">3.管理人员到位</span>
</td>
</tr>
<tr>
<td>
<table width="100%" class="table_print" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">到位时间到位人员</span></td>
<td align="center"><span style="font-family: &quot;宋体&quot;; font-size: 12pt">发现问题或建议</span></td>
</tr>
<c:forEach items="${workCardOneBZList}" var="cardbz" varStatus="tatus" >
<tr id = "tr${tatus.index}" class = "repeat">
<td>&nbsp;<label>${cardbz.dwdate}</label></td>			
<td><label>${cardbz.dwry}</label></td>
<td><label>${cardbz.quetionandsuggest}</label></td>
</tr>
</c:forEach>
</table>
</td>
</tr>
</table>	
</body>
<object id="webbrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"  width="0"></object>
</html>